package com.haixiaoke.saas.order.service;

import cn.hutool.core.date.DateTime;
import com.haixiaoke.saas.order.domain.OrderLock;

import java.util.Date;
import java.util.List;

/**
 * 订单锁单Service接口
 *
 * @author panda
 * @date 2024-02-01
 */
public interface IOrderLockService {
    /**
     * 查询订单锁单
     *
     * @param lockId 订单锁单主键
     * @return 订单锁单
     */
    public OrderLock selectOrderLockByLockId(Long lockId);

    /**
     * 查询订单锁单列表
     *
     * @param orderLock 订单锁单
     * @return 订单锁单集合
     */
    List<OrderLock> selectOrderLockList(OrderLock orderLock);

    /**
     * 新增订单锁单
     *
     * @param orderLock 订单锁单
     * @return 结果
     */
    public int insertOrderLock(OrderLock orderLock);

    /**
     * 修改订单锁单
     *
     * @param orderLock 订单锁单
     * @return 结果
     */
    int updateOrderLock(OrderLock orderLock);

    /**
     * 批量删除订单锁单
     *
     * @param lockIds 需要删除的订单锁单主键集合
     * @return 结果
     */
    int deleteOrderLockByLockIds(Long[] lockIds);

    /**
     * 删除订单锁单信息
     *
     * @param lockId 订单锁单主键
     * @return 结果
     */
    int deleteOrderLockByLockId(Long lockId);

    /**
     * 校验订单在该时间段内是否可以下单
     *
     * @param checkInTime  入住时间
     * @param checkOutTime 退房时间
     * @param houseId      房屋id
     * @param orderId      订单id
     * @return true为不可以下单
     */
    Boolean checkHouseLock(Date checkInTime, Date checkOutTime, String houseId, String orderId, Boolean isStrict);

    int deleteOrderLockByOrderId(String orderId);

    List<OrderLock> selectOrderLockListByHouseId(String houseId, DateTime date);

    int updateOrderLockByOrderId(OrderLock lock);

    OrderLock selectOrderLockByOrderId(String orderId);
}
